define(function(require, exports, module) {
    var ALL = require("../../common/all"),
        CONFIG = ALL.CONFIG,
        METHOD = ALL.METHOD,
        Dialog = ALL.Dialog,
        Init = ALL.Init;

    var _Dialog = new Dialog({
        title : "提示",
        content : "<p>是否确定添加？</p>",
        text4Btn: ["确定","取消"],
        class4Btn: ["","line"]
    });


    var _vm = Init.initVue({
        data : {
            id : null,
            check: {},
            typeArr : [],
            res : {
                team_id : "",
            }
        },
        methods: {
            submit : function() {
                var flag;

                this.check.$valid();
                flag = this.check.flag;

                if (!flag) { return; }

                _Dialog.showUI(function(i) {
                    if (i == 0) {
                        METHOD.loading.show();
                        METHOD.ajax("team/specific/create",{ data: JSON.stringify(_vm.res)},{type : 'post'}).done(function(){
                            METHOD.loading.hide();
                            METHOD.alert("操作成功").done(function(){
                                window.location.href = "../team/specific.html";
                            });
                        }).fail(function(){
                            METHOD.loading.hide();
                        });
                    }
                    this.hideUI();
                });
            },
            getList : function() {
                METHOD.loading.show();
                METHOD.ajax("team/specific/can",{}).done(function(json){
                    METHOD.loading.hide();
                    _vm.typeArr = json.data;

                }).fail(function(){
                    METHOD.loading.hide();
                })
            }
        }
    });

    _vm.getList();


});

